Skip to content

Fix DocumentFragment missing createElementNS#5162

Closed
JoviDeCroock wants to merge 1 commit into
mainfrom
JoviDeCroock/investigate-4539
Closed

Fix DocumentFragment missing createElementNS#5162
JoviDeCroock wants to merge 1 commit into
mainfrom
JoviDeCroock/investigate-4539

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Jul 16, 2026

Copy link
Copy Markdown
Member

Fixes #4539

Falls back to createElement when createElementNS is unavailable. With passing ownerDocument to the portal we save part of the issue, however the faux-DOM passed from the library is missing createElementNS.

Do we want to land this? Hypothetically it's a compat concern

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: faster ✔ 0% - 1% (0.17ms - 11.39ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.07ms - +0.01ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +2% (-0.27ms - +1.14ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.02ms - +0.03ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -3% - +1% (-1.45ms - +0.31ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -4% - +4% (-0.08ms - +0.09ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +1% (-0.08ms - +0.27ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -6% - +0% (-1.52ms - +0.12ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +6% (-0.05ms - +0.29ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +5% (-0.02ms - +0.05ms)
    preact-local vs preact-main
  • todo: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local838.93ms - 844.09ms-faster ✔
0% - 1%
0.17ms - 11.39ms
preact-main842.31ms - 852.28msslower ❌
0% - 1%
0.17ms - 11.39ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.08ms - 19.08ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main19.08ms - 19.08msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.50ms - 16.56ms-unsure 🔍
-0% - +0%
-0.07ms - +0.01ms
preact-main16.54ms - 16.58msunsure 🔍
-0% - +0%
-0.01ms - +0.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.55ms - 1.56ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.55ms - 1.56msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local57.09ms - 58.15ms-unsure 🔍
-0% - +2%
-0.27ms - +1.14ms
preact-main56.72ms - 57.65msunsure 🔍
-2% - +0%
-1.14ms - +0.27ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local5.08ms - 5.37ms-unsure 🔍
-1% - +6%
-0.05ms - +0.29ms
preact-main5.02ms - 5.20msunsure 🔍
-5% - +1%
-0.29ms - +0.05ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.54ms - 16.58ms-unsure 🔍
-0% - +0%
-0.02ms - +0.03ms
preact-main16.54ms - 16.57msunsure 🔍
-0% - +0%
-0.03ms - +0.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.74ms - 3.74ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.74ms - 3.74msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5677
  • Commit: d88b147

duration

VersionAvg timevs preact-localvs preact-main
preact-local55.52ms - 56.65ms-unsure 🔍
-3% - +1%
-1.45ms - +0.31ms
preact-main55.98ms - 57.33msunsure 🔍
-1% - +3%
-0.31ms - +1.45ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.01ms - 3.01ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.01ms - 3.01msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local29.62ms - 30.47ms-unsure 🔍
-1% - +3%
-0.19ms - +0.95ms
preact-main29.28ms - 30.05msunsure 🔍
-3% - +1%
-0.95ms - +0.19ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local34.01ms - 35.24ms-unsure 🔍
-3% - +2%
-1.18ms - +0.67ms
preact-main34.20ms - 35.57msunsure 🔍
-2% - +3%
-0.67ms - +1.18ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local30.40ms - 31.58ms-unsure 🔍
-3% - +3%
-0.84ms - +0.85ms
preact-main30.38ms - 31.59msunsure 🔍
-3% - +3%
-0.85ms - +0.84ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local26.22ms - 26.95ms-unsure 🔍
-1% - +2%
-0.19ms - +0.63ms
preact-main26.18ms - 26.56msunsure 🔍
-2% - +1%
-0.63ms - +0.19ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local23.28ms - 24.81ms-unsure 🔍
-8% - +1%
-2.02ms - +0.18ms
preact-main24.17ms - 25.76msunsure 🔍
-1% - +8%
-0.18ms - +2.02ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local20.64ms - 21.02ms-unsure 🔍
-1% - +1%
-0.24ms - +0.30ms
preact-main20.60ms - 20.99msunsure 🔍
-1% - +1%
-0.30ms - +0.24ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 180
  • Built by: CI #5677
  • Commit: d88b147

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.05ms - 2.17ms-unsure 🔍
-4% - +4%
-0.08ms - +0.09ms
preact-main2.04ms - 2.17msunsure 🔍
-4% - +4%
-0.09ms - +0.08ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.02ms - 1.06ms-unsure 🔍
-2% - +5%
-0.02ms - +0.05ms
preact-main1.00ms - 1.04msunsure 🔍
-4% - +1%
-0.05ms - +0.02ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.41ms - 31.67ms-unsure 🔍
-0% - +1%
-0.08ms - +0.27ms
preact-main31.33ms - 31.57msunsure 🔍
-1% - +0%
-0.27ms - +0.08ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.26ms - 1.26ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main1.26ms - 1.26msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
update10th1k
  • Browser: chrome-headless
  • Sample size: 140
  • Built by: CI #5677
  • Commit: d88b147

duration

VersionAvg timevs preact-localvs preact-main
preact-local25.27ms - 26.36ms-unsure 🔍
-6% - +0%
-1.52ms - +0.12ms
preact-main25.90ms - 27.13msunsure 🔍
-1% - +6%
-0.12ms - +1.52ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.97ms - 2.97ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-main2.97ms - 2.98msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-

tachometer-reporter-action v2 for CI

@github-actions

Copy link
Copy Markdown

Size Change: +8 B (+0.05%)

Total Size: 15.8 kB

📦 View Changed
Filename Size Change
dist/preact.mjs 4.84 kB +8 B (+0.17%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.mjs 3.87 kB
debug/dist/debug.mjs 3.89 kB
devtools/dist/devtools.mjs 274 B
hooks/dist/hooks.mjs 1.55 kB
jsx-runtime/dist/jsxRuntime.mjs 861 B
test-utils/dist/testUtils.mjs 473 B

compressed-size-action

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.532%. remained the same — JoviDeCroock/investigate-4539 into main

@rschristian

Copy link
Copy Markdown
Member

Do we want to land this? Hypothetically it's a compat concern

They're passing in a faux DOM node? IMO, we shouldn't fallback here. I get that it's a compat issue but it should be on the caller to supply a sufficiently robust fake, not on the library to fallback when that fails.

Any chance we/they/some bot can/are willing to fix this downstream instead?

@JoviDeCroock

Copy link
Copy Markdown
Member Author

I'll close out the source issue with that comment, you are right

@JoviDeCroock
JoviDeCroock deleted the JoviDeCroock/investigate-4539 branch July 16, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible bug: phantom VDOM node erroring render when using React Aria ListBoxItem

3 participants